package V1.mysql;

import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;

public class oracel {

    private static String url;
    private static String username;
    private static String password;

    public static void getParam(String fileName) throws IOException {
        Properties p=new Properties();
        InputStream ins= oracel.class.getClassLoader().getResourceAsStream(fileName);
        p.load(ins);
        url=p.getProperty("url");
        username=p.getProperty("username");
        password=p.getProperty("password");
        System.out.println("测试链接成功；"+url+username+password);
    }

    public static void main(String[] args) throws IOException, SQLException {
        oracel.getParam("db_oracle.properties");
        Connection con= DriverManager.getConnection(url,username,password);
        String sql="delete from ap_login where id=1";
        Statement st=con.createStatement();
        int rows=st.executeUpdate(sql);
        System.out.println("成功的数据条数："+rows);
    }
}
